home *** CD-ROM | disk | FTP | other *** search
- {*********************************************************}
- {* AALZBase *}
- {* Copyright (c) Julian M Bucknall 1998-1999 *}
- {* All rights reserved. *}
- {*********************************************************}
- {* Algorithms Alfresco LZ77 unit - Base Unit *}
- {*********************************************************}
-
- {Note: this unit is released as freeware. In other words, you are free
- to use this unit in your own applications, however I retain all
- copyright to the code. JMB}
-
- unit AALZBase;
-
- interface
-
- uses
- SysUtils;
-
- type
- TaaLZKey = packed record {a 3-character signature string}
- case boolean of
- false : (AsLong : longint);
- true : (AsString : string[3]);
- end;
-
-
- {Notes: the following constants define the range of values for the
- distance and length encodings. Generally the distance shift
- value is 3, making the size of the sliding window 8192 bytes
- and the maximum length to match 10 bytes. You can experiment
- by setting the shift value to 4 (sliding window is 4096 bytes,
- max length is 18 bytes) or even 2 (window is 16384 bytes, max
- length is 6 bytes). The bigger the sliding window, the slower
- the compression is since there's more to compare to get the
- longest match}
- const
- aalzDistanceShift = 4; {..3}
- aalzLengthMask = (1 shl aalzDistanceShift) - 1; {..$7}
- aalzSlidingWindowSize = (1 shl (16 - aalzDistanceShift)); {..8192}
- aalzMaxMatchLength = aalzLengthMask + 3; {..10}
- aalzLookAheadSize = aalzMaxMatchLength; {..10}
-
- implementation
-
- end.
-